from base.base import Base
from time import sleep
from selenium.webdriver.common.by import By

class ShousuoPage(Base):

    shoucang=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TabHost/android.widget.LinearLayout/android.widget.TabWidget/android.widget.RelativeLayout[3]/android.widget.LinearLayout/android.widget.ImageView')

    shousuokuang=(By.ID,'com.xiachufang:id/search_edit_text')

    shurukuang=(By.XPATH,'//android.widget.EditText[@text="搜索我的收藏"]')

    shousuoanniu='new UiSelector().text=("搜索")'

    dy1=(By.XPATH,'//android.widget.TextView[@text="蒜蓉虾滑煲"]')

    dy2=(By.XPATH,'//android.widget.TextView[@text="这个页面是空的"]')

    def shousuoyewu(self,password):

        self.loc_ele(self.shoucang).click()
        sleep(2)

        self.loc_ele(self.shousuokuang).click()
        sleep(2)

        self.loc_ele(self.shurukuang).send_keys(password)
        sleep(2)

        self.loc_ui_ele(self.shousuoanniu).click()
        sleep(2)